package com.itlong.cloud.common.network.tcp.netty;

import com.itlong.cloud.POJO.DTO.common.ParkingMessageDTO;
import com.itlong.cloud.enumerate.ParkingBusinessOrderEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;

/**
 * <desc>
 *      暴露操作netty通道接口Feign代理接口
 * </desc>
 *
 * @createDate 2017/12/07
 */
@FeignClient(name = "common-service")
public interface INettyServiceClient {


/**
     * <desc>
     *      发送查询出场记录指令
     * </desc>
     *
     * @param clientKey 客户端的唯一标识KEY
     * @param content 参数(JSON格式)
     * @param parkingBusinessOrderEnum 出入场类型
     * @author Wenchao.L
     * @createDate 2018/11/7
     */
    @RequestMapping(path="/network/netty/sendQueryInOrOutRecord",method = {RequestMethod.POST})
    void sendQueryInOrOutRecord(@RequestParam("clientKey") String clientKey, @RequestParam("content") String content,
                                       @RequestParam("parkingBusinessOrderEnum") ParkingBusinessOrderEnum parkingBusinessOrderEnum,
                                       @RequestParam("projectId") String projectId) throws IOException;


    /**
     * <desc>
     *      发送算费缴费指令
     * </desc>
     *
     * @param clientKey 客户端的唯一标识KEY
     * @param content 参数(JSON格式)
     * @param parkingBusinessOrderEnum 出入场类型
     * @return 受影响行数
     * @author Wenchao.L
     * @createDate 2018/11/7
     */
    @RequestMapping(path="/network/netty/synOrderByParking",method = {RequestMethod.POST})
    ParkingMessageDTO synOrderByParking(@RequestParam("clientKey") String clientKey, @RequestParam("content") String content,
                                        @RequestParam("parkingBusinessOrderEnum") ParkingBusinessOrderEnum parkingBusinessOrderEnum, @RequestParam("messageId") String messageId) throws IOException, InterruptedException;

}
